package com.zj.study.utils.beancopier;

import java.lang.reflect.Method;
import org.springframework.asm.MethodVisitor;
import org.springframework.asm.Type;

/**
 * @author 赵赳
 * @since 2021/9/22 11:44
 */
public class MethodWriterUtils {

  public static void visitMethodInsn(MethodVisitor visitor, int opcode, Method method) {
    visitor
        .visitMethodInsn(opcode, Type.getInternalName(method.getDeclaringClass()), method.getName(),
            Type.getMethodDescriptor(method), method.getDeclaringClass().isInterface());
  }

  private MethodWriterUtils() {
  }
}